def str_reverse(s):
    """
    将字符串进行反转
    :param s: 需要反转的字符串
    :return: 反转过后的字符串
    """
    rev = s[::-1]
    print(f"{s}的反转内容为：{rev}")
    return rev


def substr(s, x, y):
    """
    对字符串进行切片
    :param s: 需要切片的字符串
    :param x: 切片起始下标
    :param y: 切片终止下标
    :return: 切片结果
    """
    sub = s[x:y:1]
    print(f"{s}按照[{x}:{y}:1]切片的结果是：{sub}")
    return sub


if __name__ == '__main__':
    str_reverse("黑马程序员")
    substr("黑马程序员", 1, 3)
